class CuotasController < ApplicationController
  # GET /cuotas
  # GET /cuotas.xml
  def index
    @cuotas = Cuota.all

    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @cuotas }
    end
  end

  # GET /cuotas/1
  # GET /cuotas/1.xml
  def show
    @cuota = Cuota.find(params[:id])

    respond_to do |format|
      format.html # show.html.erb
      format.xml  { render :xml => @cuota }
    end
  end

  # GET /cuotas/new
  # GET /cuotas/new.xml
  def new
    @cuota = Cuota.new

    respond_to do |format|
      format.html # new.html.erb
      format.xml  { render :xml => @cuota }
    end
  end

  # GET /cuotas/1/edit
  def edit
    @cuota = Cuota.find(params[:id])
  end

  # POST /cuotas
  # POST /cuotas.xml
  def create
    @cuota = Cuota.new(params[:cuota])

    respond_to do |format|
      if @cuota.save
        flash[:notice] = 'Cuota was successfully created.'
        format.html { redirect_to(@cuota) }
        format.xml  { render :xml => @cuota, :status => :created, :location => @cuota }
      else
        format.html { render :action => "new" }
        format.xml  { render :xml => @cuota.errors, :status => :unprocessable_entity }
      end
    end
  end

  # PUT /cuotas/1
  # PUT /cuotas/1.xml
  def update
    @cuota = Cuota.find(params[:id])

    respond_to do |format|
      if @cuota.update_attributes(params[:cuota])
        flash[:notice] = 'Cuota was successfully updated.'
        format.html { redirect_to(@cuota) }
        format.xml  { head :ok }
      else
        format.html { render :action => "edit" }
        format.xml  { render :xml => @cuota.errors, :status => :unprocessable_entity }
      end
    end
  end

  # DELETE /cuotas/1
  # DELETE /cuotas/1.xml
  def destroy
    @cuota = Cuota.find(params[:id])
    @cuota.destroy

    respond_to do |format|
      format.html { redirect_to(cuotas_url) }
      format.xml  { head :ok }
    end
  end
end
